<div class="content">  
  <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/tables.css">
  <style>
    #button {
        border:1px solid;
        float:right;
        cursor:pointer;
        font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
        font-size:12px;
        padding:3px 10px;
        text-decoration:none;
    }
  </style>
  <div style="text-align; padding:20px 5px 5px 5px; overflow-y:auto;" class="tables"> 
    <form class="from2" name="form2" method="POST" action="" >
      <table class="colorTable" style="width:100%;" border="1" cellspacing="0" cellpadding="0" align="center"> 
      <tbody> 
        <tr> 
        <th width="11.1%" height="15" valign="top" bgcolor="#CCCCCC"> 
        <p align="center">Username</p> 
        </th> 
        <th width="11.1%"  valign="top" bgcolor="#CCCCCC"> 
        <p align="center">申请人</p> 
        </th> 
        <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
        <p align="center">申请人部门</p> 
        </th> 
        <th width="11.1%" valign="top" bgcolor="#CCCCCC"> 
          <p align="center">全选
          <input type="checkbox" name="APPROAVL" value="" onclick="if(this.checked==true){checkAll(); } else { clearAll(); }" />
          </p> 
        </th> 
        </tr> 
        {% for bd in new %}
        <tr> 
        </td height=10 > 
        <td > 
        <p align="center" >{{ bd.USER }}</p> 
        </td> 
        <td > 
        <p align="center">{{ bd.CHUSER }}</p> 
        </td> 
        <td > 
        <p align="center" >{{ bd.ORG }}</p> 
        </td> 
        <td > 
          <input type="checkbox" value="True" name="{{ bd.USER }}" />
        </td> 
        </tr> 
        {% endfor %}
      </tbody>
      </table>
      <br>
      <input type="submit" name="Button" id="button" value="同意" />
      <input type="submit" name="Clear" id="button" value="清除" />
    </form>
  </div>
   <script type="text/javascript">
   function checkAll()
   {
     var el = document.getElementsByTagName('input');
     var len = el.length;
     //console.log();
     for(var i=0; i<len; i++)
     {
       if(el[i].type=="checkbox")
       {
         el[i].checked = true;
       }
     }
   }
   function clearAll()
   {
     var el = document.getElementsByTagName('input');
     var len = el.length;
     for(var i=0; i<len; i++)
     {
       if(el[i].type=="checkbox")
       {
         el[i].checked = false;
       }
     }
   }
   </script>
</div>
